FROM golang:1.16 as builder

WORKDIR /tmp/snake

COPY . /tmp/snake

RUN /tmp/snake/build.sh
# -----------------------------------------------------------------------------

FROM golang:1.16

WORKDIR /app

RUN mkdir -p /app/logs /app/config

COPY --from=builder /tmp/snake/snake .
COPY docker/entrypoint.sh .
RUN chmod +x ./snake ./entrypoint.sh

ENTRYPOINT [ "/app/entrypoint.sh" ]

CMD /app/snake